// recursion.js
// 递归

function toUpperArray(items) {
    if (!items.length) return []
    var head = items[0]
    head = head.toUpperCase()
    var tail = items.slice(1)
    return [head].concat(toUpperArray(tail))
}

console.log(toUpperArray(['hello', 'world']))
